import api from '@/utils/api'
export const commonMixin = {
  methods: {
    getDefaultAddress () {
      api.getAddress().then(res => {
        let records = res.data.records
        if (!records[0] || records[0].isDefault != '1') return
        let {contact, mobile, province, city, county, town, address} = records[0]
        let sendInfo = {
          senderMobile: mobile,
          sender: contact,
          senderProvince: province,
          senderCity: city,
          senderCounty: county,
          senderTown: town,
          senderLocation: address
        }
        this.$store.commit('user/SET_SEND_INFO', sendInfo)
      })
    },
  }
}
